package com.alpaak.controller;

import com.alpaak.entity.User;
import com.alpaak.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController //标记为MVC的控制器类，方便DispatcherServlet进行扫描定位
public class UserController {
    @Resource
    private UserService userService;

    @GetMapping("/findUser")
    public User findUser() {
        int id = 1;
        return userService.findUserById(id);
    }
}
